home *** CD-ROM | disk | FTP | other *** search
/ NBC Slam Jams! / NBC Slam Jams!.iso / xtras / media_la / fx_set_1.fxm / 00121_Script_CheckBox Button < prev    next >
Text File  |  1998-01-20  |  2KB  |  70 lines

  1. property pSpriteNum, pStatus, pActive, pCallBackObj, pRefcon
  2.  
  3. on new me, proplist
  4.   set pSpriteNum = getAProp(proplist,#sprite)
  5.   set pStatus = getAProp(proplist,#cur)
  6.   set pActive = getAProp(proplist,#active)
  7.   set pCallBackObj = getAProp(proplist,#callback)
  8.   set pRefcon = getAProp(proplist,#ref)
  9.   
  10.   SetUp(me, pStatus)
  11.   SetEnabled(me,pActive)
  12.   
  13.   return(me)
  14. end
  15.  
  16. on Click me, sNum
  17.   if not pActive then exit
  18.   if not integerP(sNum) then set sNum = the clickOn
  19.   if the memberNum of sprite sNum < 1 then exit
  20.   if not (the name of the member of sprite sNum contains "checkBox") then exit
  21.   
  22.   put the name of the member of sprite sNum into memName
  23.   
  24.   set the member of sprite sNum = member (memName&&"Down")
  25.   updateStage
  26.   set selected = TRUE
  27.   
  28.   repeat while the stillDown
  29.     if rollover(sNum) then
  30.       set the member of sprite sNum = member (memName&&"Down")
  31.       set selected = TRUE
  32.     else
  33.       set the member of sprite sNum = member (memName)
  34.       set selected = FALSE
  35.     end if
  36.     updateStage
  37.   end repeat
  38.   
  39.   SetUp(me,not pStatus)
  40.   if objectP(pCallBackObj) then
  41.     CheckBox(pCallBackObj, pRefcon, pStatus)
  42.   end if
  43.   return(pStatus)
  44. end
  45.  
  46. on SetUp me, newNum
  47.   set pStatus = newNum
  48.   refresh(me)
  49. end 
  50.  
  51. on refresh me
  52.   puppetSprite pSpriteNum, TRUE
  53.   if pStatus then
  54.     set the member of sprite pSpriteNum = member "checkBox 1"
  55.   else
  56.     set the member of sprite pSpriteNum = member "checkBox 0"
  57.   end if
  58. end
  59.  
  60.  
  61. on SetEnabled me, enabled
  62.   set pActive = enabled
  63. end
  64.  
  65. on Release me
  66.   puppetSprite pSpriteNum, FALSE
  67. end
  68.  
  69.  
  70.